package com.canaan.business.service.inOutStock;

import com.canaan.business.domain.inOutStock.WmsOutStockOrder;
import com.canaan.business.domain.storehouse.StockCheckDiff;
import com.canaan.business.domain.vo.StockDetailProductVo;
import com.canaan.business.domain.vo.WmsOutStockOrderVo;

import java.util.List;

/**
 * 出库单Service接口
 *
 * @author ruoyi
 * @date 2022-12-20
 */
public interface IWmsOutStockOrderService
{
    /**
     * 查询出库单
     *
     * @param id 出库单主键
     * @return 出库单
     */
    WmsOutStockOrder selectWmsOutStockOrderById(Long id);

    /**
     * 查询出库单列表
     *
     * @param outStockOrder 出库单
     * @return 出库单集合
     */
    List<WmsOutStockOrder> selectWmsOutStockOrderList(WmsOutStockOrder outStockOrder);

    /**
     * 新增出库单
     *
     * @param outStockOrder 出库单
     * @return 结果
     */
    int insertWmsOutStockOrder(WmsOutStockOrder outStockOrder);

    /**
     * 批量新增出库单
     *
     * @param outStockOrderList 出库单列表
     * @return 结果
     */
    int batchInsertWmsOutStockOrder(List<WmsOutStockOrder> outStockOrderList);

    /**
     * 修改出库单
     *
     * @param outStockOrder 出库单
     * @return 结果
     */
    int updateWmsOutStockOrder(WmsOutStockOrder outStockOrder);

    /**
     * 出库单取消
     *
     * @param outStockOrder 出库单
     * @return 结果
     */
    int cancel(WmsOutStockOrder outStockOrder);

    /**
     * 批量修改出库单
     *
     * @param outStockOrderList 出库单列表
     * @return 结果
     */
    int batchUpdateWmsOutStockOrder(List<WmsOutStockOrder> outStockOrderList);

    /**
     * 批量删除出库单
     *
     * @param ids 需要删除的出库单主键集合
     * @return 结果
     */
    int deleteWmsOutStockOrderByIds(Long[] ids);

    /**
     * 删除出库单信息
     *
     * @param id 出库单主键
     * @return 结果
     */
    int deleteWmsOutStockOrderById(Long id);

    /**
     * 查询出库单
     *
     * @param no 编号
     * @return 出库单
     */
    WmsOutStockOrder selectWmsOutStockOrderByNo(String no);

    /**
     * 批量删除出库单
     *
     * @param nos 需要删除的编号集合
     * @return 结果
     */
    int deleteWmsOutStockOrderByNos(String[] nos);

    /**
     * 删除出库单信息
     *
     * @param no 编号
     * @return 结果
     */
    int deleteWmsOutStockOrderByNo(String no);

    /**
     * 导出列表查询
     * @param entity    参数
     * @return 导出列表
     */
    List<WmsOutStockOrderVo> exportList(WmsOutStockOrder entity);

    WmsOutStockOrder selectWmsOutStockOrderByRelOrderNo(String no,Integer orderType);

    List<WmsOutStockOrder> selectListOrderByRelOrderNo(String no,Integer orderType);

    void initBillStockOrder(String no, Integer code, List<StockDetailProductVo> stockDetailProductVos,String customerNo,String workOrderNo);

    /**
     * 删除出库单信息
     *
     * @param relOrderNos 来源单据编号
     * @param orderType 对应的出库单类型
     * @return 结果
     */
    public int deleteWmsOutStockOrderByRelOrderNosAndType(List<String> relOrderNos, Integer orderType);

    WmsOutStockOrder directOutStock(String no, Integer code, List<StockCheckDiff> outStockVos, String remark);


}
